package com.numbfish.bean_factory.ex_04_annotation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class FXNewsProvider {
    @Autowired
    private DowJonesNewsListener newsListener;
    @Autowired
    private DowJonesNewsPersister newsPersister;

    public FXNewsProvider() {
    }

    public FXNewsProvider(DowJonesNewsListener newsListener, DowJonesNewsPersister newsPersister) {
        this.newsListener = newsListener;
        this.newsPersister = newsPersister;
    }

    public DowJonesNewsListener getNewsListener() {
        return newsListener;
    }

    public void setNewsListener(DowJonesNewsListener newsListener) {
        this.newsListener = newsListener;
    }

    public DowJonesNewsPersister getNewsPersister() {
        return newsPersister;
    }

    public void setNewsPersister(DowJonesNewsPersister newsPersister) {
        this.newsPersister = newsPersister;
    }

    public void getAndPersistNews() {
        System.out.println("called getAndPersistNews in ex_04");
    }
}
